import { getToken, setToken, setUserInfo, getUserInfo } from '@/utils/storage'

export default {
  namespaced: true,
  state () {
    return {
      token: getToken() || '',
      userInfo: getUserInfo() || {}
    }
  },
  mutations: {
    setToken (state, token) {
      state.token = token
      setToken(token)
    },
    setUserInfo (state, userInfo) {
      state.userInfo = userInfo
      setUserInfo(userInfo)
    }
  },
  actions: {},
  getters: {}
}
